<?php include_once("header.html")?>

<div id="wrap">  <br />

<?php include_once("home_left.html")?>

<div class="admincontent">

		<div style="float:right;margin-right:10px;">
      <a href="javascript:showprintpage(1)"><img src="<?php echo $www_site_url?>/public/images/print_icon.jpg" border="0" title="Print"></a>
      </div>
      <!--startprint1-->
		<?php
		 // header("Content-type:application/vnd.ms-excel");
	    //  header("Content-Disposition:attachment;filename=test_data.xlsx");

		if(isset($report_questions) && is_array($report_questions)){?>
			<?php echo lang("assignment");?>：《<?php echo splitx($assignment['a_title'])?>》 <?php echo substr($assignment['a_fdate'],0,10)?> <?php echo lang("stores");?>：<?php echo splitx(stripslashes($assignment['cs_name']));?>
			<br />
			总分：<?php echo $totalvalue;?>
			<br/>
		   <?php echo lang("grade_info");?>：
			<table width="100%" border="0" cellpadding="0" cellspacing="1" class="missionReport" class="clear">

          <?php if($mark_type == 10){?>
          <tr>
            <td class="title"><?php echo lang("level_0")?></td>
            <td class="title"><?php echo lang("level_8")?></td>
            <td class="title"><?php echo lang("level_1")?></td>
            <td class="title"><?php echo lang("level_3")?></td>
            <td class="title"><?php echo lang("level_4")?></td>
            <td class="title"><?php echo lang("level_5")?></td>
            <td class="title"><?php echo lang("level_6")?></td>
            <td class="title"><?php echo lang("level_7")?></td>
          </tr>
          <tr>
            <td align="center">n/a</td>
            <td align="center">0</td>
            <td align="center">1-2</td>
            <td align="center">3-4</td>
            <td align="center">5</td>
            <td align="center">6-7</td>
            <td align="center">8-9</td>
            <td align="center">10</td>
          </tr>
          <?php }else if($mark_type == 5){?>
          <tr>
            <td class="title"><?php echo lang("level_0")?></td>
            <td class="title"><?php echo lang("level_8")?></td>
            <td class="title"><?php echo lang("level_1")?></td>
            <td class="title"><?php echo lang("level_3")?></td>
            <td class="title"><?php echo lang("level_4")?></td>
            <td class="title"><?php echo lang("level_5")?></td>
            <td class="title"><?php echo lang("level_7")?></td>
          </tr>
          <tr>
            <td align="center">n/a</td>
            <td align="center">0</td>
            <td align="center">1</td>
            <td align="center">2</td>
            <td align="center">3</td>
            <td align="center">4</td>
            <td align="center">5</td>
          </tr>
          <?php }else if($mark_type == 4){?>
          <tr>
           <td class="title"><?php echo lang("level_0")?></td>
            <td class="title"><?php echo lang("level_8")?></td>
            <td class="title"><?php echo lang("level_1")?></td>
            <td class="title"><?php echo lang("level_4")?></td>
            <td class="title"><?php echo lang("level_5")?></td>
            <td class="title"><?php echo lang("level_7")?></td>
          </tr>
          <tr>
            <td align="center">n/a</td>
            <td align="center">0</td>
            <td align="center">1</td>
            <td align="center">2</td>
            <td align="center">3</td>
            <td align="center">4</td>
          </tr>
          <?php }else if($mark_type == 2){?>
          <tr>
           <td class="title"><?php echo lang("level_0")?></td>
            <td class="title"><?php echo lang("level_8")?></td>
            <td class="title"><?php echo lang("level_1")?></td>
            <td class="title"><?php echo lang("level_7")?></td>
          </tr>
          <tr>
            <td align="center">n/a</td>
            <td align="center">0</td>
            <td align="center">1</td>
            <td align="center">2</td>
          <?php }?>
          </table>

         <table width="100%" border="0" cellpadding="0" cellspacing="1" class="missionReport" style="margin-top:20px;">
          <tr>
            <td colspan="3" class="title" bgcolor="#9F0000" align="left" height="20"><font color="#FFFFFF"><?php echo lang('spot_mystery');?></font></td>
          </tr>
          <tr>
            <td width="250" align="left"><?php echo lang('gender')?>:</td>
            <td  align="left"><?php if($ms_info['gender']==1) echo lang('boy');if($ms_info['gender']==2) echo lang('girl'); ?></td>
           </tr>
          <tr>
            <td align="left"><?php echo lang('age')?>:</td>
            <td  align="left">     <?php $year = substr($ms_info['birthdate'],0,4); if($year!='0000') echo date("Y")-$year;?>       </td>
           </tr>
           <tr>
            <td align="left"><?php echo lang('marriage')?>:</td>
            <td  align="left"> <?php if($ms_info['marital']=="S") echo lang('single');
            if($ms_info['marital']=="M") echo lang('married');
            if($ms_info['marital']=="D") echo lang('divorced'); ?>           </td>
           </tr>
            <tr>
            <td  align="left"><?php echo lang('nationality')?>:</td>
            <td  align="left"> <?php echo $ms_info['nationality'];?></td>
           </tr>
           <tr>
            <td align="left"><?php echo lang('salary')?>:</td>
            <td  align="left"> <?php if($ms_info['householdincome']==1) echo "＜ 3,000";
            if($ms_info['householdincome']==2) echo "3,000-6,000";
            if($ms_info['householdincome']==3) echo "6,000-9,000";
            if($ms_info['householdincome']==4) echo "9,000-12,000";
            if($ms_info['householdincome']==5) echo "12,000-15,000";
            if($ms_info['householdincome']==6) echo "15,000-30,000";
            if($ms_info['householdincome']==7) echo "＞ 30,000";
              ?>RMB</td>
           </tr>
          </table>
	<?php
		foreach ($report_questions as $k=>$v){if(!empty($v)){?>
		<table width="100%" border="0" cellpadding="0" cellspacing="1" class="missionReport" style="margin-top:20px;">
          <tr>
            <td colspan="3" class="title" bgcolor="#9F0000" align="left" height="20"><font color="#FFFFFF"><?php echo lang($k);?> &nbsp; 本项得分：<?php echo $v['sessionvalue'];?></font></td>
          </tr>

          <?php
			foreach ($v as $kk=>$vv){
				if($vv['rq_type']==2 || $vv['rq_type']==4 || $vv['rq_type']==1){
				?>
          <tr>
			 <td width="25"><?php echo $GLOBALS['gGroupsCap'][$k]. "".($kk+1)?></td>
            <td align="left"><span id="br_30"><?php echo splitx($vv['rq_question']);?></span></td>
           <td width="80" align="left">
            <?php
            	if($vv['rq_type']==2){
            		if($vv['answer']=='A') echo 'N/A';
            		else
            		echo ($vv['answer']==0)?"０":splitx($vv['answer']);
            	}else if($vv['rq_type']==1){
					if($vv['answer']=='Y')echo 'Yes';
					if($vv['answer']=='N')echo 'No';
					if($vv['answer']=='A')echo 'N/A';
            	}else if($vv['rq_type']==4){
            		echo $vv['answer']."分钟";
				 }
				 ?>
            </td>
          </tr>
           <?php if($vv['is_comment']==1){?>
          <tr <?php if(!$vv['comment']) echo 'style="display:none;"'?> id="td_comment_<?php echo $vv['rq_id'];?>">
           <td></td>
           <td colspan="2" ><span id="br_32"><?php echo splitx($vv['comment']);?></span></td>
          </tr>
          <?php }?>
       		 <?php
				}else if($vv['rq_type']==3){

					if($vv['rq_group']==5){
					?>
			<tr>
			 <td width="5"><?php echo $GLOBALS['gGroupsCap'][$k]. "".($kk+1)?></td>
			  <td align="left" width="300"><span id="br_26"><?php echo splitx($vv['rq_question']);?></span></td>
              <td width="200" align="left"><span id="br_13"><?php echo splitx($vv['answer']);?></span></td>
          	</tr>
          <?php }else{?>
			<tr>
			 <td width="25" rowspan="2" valign="top"><?php echo $GLOBALS['gGroupsCap'][$k]. "".($kk+1);?></td>
             <td colspan="2"  bgcolor="#aaa" height="20" >
            		<span id="br_32"><?php echo splitx($vv['rq_question']);?></span>
            </td>
          </tr>
          <tr>
             <td colspan="2" height="50">
            		<span id="br_32"><?php echo splitx($vv['answer']);?></span>
            </td>
          </tr>
	   <?php }

				}

			}
			?>

        </table>
 		<?php }
 		}
		}?>

 		<!--endprint1-->
		 <TABLE width="100%" border="0" cellspacing="1" cellpadding="0" class="missionReport" style="margin-top:20px;">
<TR>
<TD width="20%" colspan="3" class="title"><?php echo lang("uploadattachment")?></TD>


</TR>
<?php
if(is_array($attachments)){
	foreach ($attachments as $k=>$a){
	?>

<TR>
<TD width="20%"><?php echo $k+1;?>.</TD>
<TD ><?php echo '<a href="/public/upload/'.$a['f_name'].'">'.$a['f_name'].'</a> '?></TD>
<TD ><?php echo $a['f_created'];?></TD>
</TR>
<?php
	}
}
?>
<TR>
</table>

</div>

</div>


<?php


include_once("footer.html")?>
